<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
    <title>PHPXRef 0.7 : OpenSSO PHP Library 1.5.1 : /open-sso.interface.php source</title>
    <link rel="stylesheet" href="sample.css" type="text/css">
    <link rel="stylesheet" href="sample-print.css" type="text/css" media="print">
    <style id="hilight" type="text/css"></style>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
	<tr>
        <td valign="top" class="pagetitle">
            [ <a href="index.html">Index</a> ]
        </td>
        <td align="right" class="pagetitle">
		    <h2 style="margin-bottom: 0px">PHP Cross Reference of OpenSSO PHP Library 1.5.1</h2>
	    </td>
    </tr>
</table>


<!-- Generated by PHPXref 0.7 at Fri Jan  8 00:38:44 2010 -->
<!-- PHPXref (c) 2000-2007 Gareth Watts - gareth@omnipotent.net -->
<!-- http://phpxref.sourceforge.net/ -->

<script src="phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
ext='.html';
relbase='';
subdir='';
filename='open-sso.interface.php.source.html';
cookiekey='opensso-phplib_1.5';
handleNavFrame(relbase, subdir, filename);

// -->
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
  document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
  document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
<script language="JavaScript" type="text/javascript">
<!--

document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');

document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
// -->
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h2 class="listing-heading"><a href="./index.html">/</a> -> <a href="open-sso.interface.php.html">open-sso.interface.php</a> (source)</h2>
<div class="listing">
<p class="viewlinks">[<a href="open-sso.interface.php.html">Summary view</a>]
[<a href="javascript:window.print();">Print</a>]
[<a href="open-sso.interface.php.source.txt" target="_new">Text view</a>]
</p>
<pre>
<a name="l1"><span class="linenum">   1</span></a>  &lt;?php
<a name="l2"><span class="linenum">   2</span></a>  <span class="comment">/**</span>
<a name="l3"><span class="linenum">   3</span></a>  <span class="comment"> * API interface for OpenSSO PHP library.</span>
<a name="l4"><span class="linenum">   4</span></a>  <span class="comment"> * </span>
<a name="l5"><span class="linenum">   5</span></a>  <span class="comment"> * This is an API so we try to not modificate this across the versions. </span>
<a name="l6"><span class="linenum">   6</span></a>  <span class="comment"> * You can use these functions in your application if you include or require the 'open-sso.class.php' file! </span>
<a name="l7"><span class="linenum">   7</span></a>  <span class="comment"> *  </span>
<a name="l8"><span class="linenum">   8</span></a>  <span class="comment"> * @category   OpenSSO_PHP</span>
<a name="l9"><span class="linenum">   9</span></a>  <span class="comment"> * @package    OpenSSO_PHP </span>
<a name="l10"><span class="linenum">  10</span></a>  <span class="comment"> * @link       http://kir-dev.sch.bme.hu/opensso-phplib/</span>
<a name="l11"><span class="linenum">  11</span></a>  <span class="comment"> * @author     Pásztor Gergő &lt;pairghu@gmail.com&gt; from KirDev &lt;kir-dev@sch.bme.hu&gt;</span>
<a name="l12"><span class="linenum">  12</span></a>  <span class="comment"> * @copyright  Copyright (c) 2009, KirDev</span>
<a name="l13"><span class="linenum">  13</span></a>  <span class="comment"> * @license    http://www.opensource.org/licenses/gpl-license.php GPL  </span>
<a name="l14"><span class="linenum">  14</span></a>  <span class="comment"> * @filesource</span>
<a name="l15"><span class="linenum">  15</span></a>  <span class="comment"> *</span>
<a name="l16"><span class="linenum">  16</span></a>  <span class="comment"> * @version 1.0.0 </span>
<a name="l17"><span class="linenum">  17</span></a>  <span class="comment"> */</span>
<a name="l18"><span class="linenum">  18</span></a>  
<a name="l19"><span class="linenum">  19</span></a>  <span class="keyword">interface </span><a class="class" onClick="logClass('openSSO_API')" href="_classes/opensso_api.html" onMouseOver="classPopup(event,'opensso_api')">openSSO_API</a>
<a name="l20"><span class="linenum">  20</span></a>  {
<a name="l21"><span class="linenum">  21</span></a>   
<a name="l22"><span class="linenum">  22</span></a>      <span class="comment">/**</span>
<a name="l23"><span class="linenum">  23</span></a>  <span class="comment">     * Get HTTP connection, not HTTPS.</span>
<a name="l24"><span class="linenum">  24</span></a>  <span class="comment">     * If the user request this 'page' with SSL (HTTPS) this function redirect to the non secured version of the 'page'</span>
<a name="l25"><span class="linenum">  25</span></a>  <span class="comment">     * (HTTP). For example: https://example.org/dir/file.php?var=1 redirect to http://example.org/dir/file.php?var=1</span>
<a name="l26"><span class="linenum">  26</span></a>  <span class="comment">     *</span>
<a name="l27"><span class="linenum">  27</span></a>  <span class="comment">     * @param void</span>
<a name="l28"><span class="linenum">  28</span></a>  <span class="comment">     * @return void</span>
<a name="l29"><span class="linenum">  29</span></a>  <span class="comment">     */</span>
<a name="l30"><span class="linenum">  30</span></a>  	public function <a class="function" onClick="logFunction('http')" href="_functions/http.html" onMouseOver="funcPopup(event,'http')">http</a>();
<a name="l31"><span class="linenum">  31</span></a>   
<a name="l32"><span class="linenum">  32</span></a>      <span class="comment">/**</span>
<a name="l33"><span class="linenum">  33</span></a>  <span class="comment">     * Get HTTPS connection, not HTTP.</span>
<a name="l34"><span class="linenum">  34</span></a>  <span class="comment">     * If the user request this 'page' without SSL (HTTP) this function redirect to the secured version of the 'page'</span>
<a name="l35"><span class="linenum">  35</span></a>  <span class="comment">     * (HTTPS). For example: http://example.org/dir/file.php?var=1 redirect to https://example.org/dir/file.php?var=1</span>
<a name="l36"><span class="linenum">  36</span></a>  <span class="comment">     *</span>
<a name="l37"><span class="linenum">  37</span></a>  <span class="comment">     * @param void</span>
<a name="l38"><span class="linenum">  38</span></a>  <span class="comment">     * @return void</span>
<a name="l39"><span class="linenum">  39</span></a>  <span class="comment">     */</span>
<a name="l40"><span class="linenum">  40</span></a>  	public function <a class="function" onClick="logFunction('https')" href="_functions/https.html" onMouseOver="funcPopup(event,'https')">https</a>();
<a name="l41"><span class="linenum">  41</span></a>   
<a name="l42"><span class="linenum">  42</span></a>      <span class="comment">/**</span>
<a name="l43"><span class="linenum">  43</span></a>  <span class="comment">     * Is secured, HTTPS connection?.</span>
<a name="l44"><span class="linenum">  44</span></a>  <span class="comment">     * If the user request this 'page' without SSL (HTTP) this function redirect to the secured version of the 'page'</span>
<a name="l45"><span class="linenum">  45</span></a>  <span class="comment">     * (HTTPS). For example: http://example.org/dir/file.php?var=1 redirect to https://example.org/dir/file.php?var=1</span>
<a name="l46"><span class="linenum">  46</span></a>  <span class="comment">     *</span>
<a name="l47"><span class="linenum">  47</span></a>  <span class="comment">     * @param void</span>
<a name="l48"><span class="linenum">  48</span></a>  <span class="comment">     * @return (bool) TRUE if is a HTTPS connection and FALSE is a HTTP connection.</span>
<a name="l49"><span class="linenum">  49</span></a>  <span class="comment">     */</span>
<a name="l50"><span class="linenum">  50</span></a>  	public function <a class="function" onClick="logFunction('isHttps')" href="_functions/ishttps.html" onMouseOver="funcPopup(event,'ishttps')">isHttps</a>();
<a name="l51"><span class="linenum">  51</span></a>   
<a name="l52"><span class="linenum">  52</span></a>      <span class="comment">/**</span>
<a name="l53"><span class="linenum">  53</span></a>  <span class="comment">     * Trigger.</span>
<a name="l54"><span class="linenum">  54</span></a>  <span class="comment">     * These function create a simple redirect to the login page.</span>
<a name="l55"><span class="linenum">  55</span></a>  <span class="comment">     * Use these function in your trigger page.</span>
<a name="l56"><span class="linenum">  56</span></a>  <span class="comment">     * In default you shouldn't use these function. But if you should put trigger to another page than the default</span>
<a name="l57"><span class="linenum">  57</span></a>  <span class="comment">     * ('trigger.php'), you can do this with this function.</span>
<a name="l58"><span class="linenum">  58</span></a>  <span class="comment">     *</span>
<a name="l59"><span class="linenum">  59</span></a>  <span class="comment">     * @example /trigger.php</span>
<a name="l60"><span class="linenum">  60</span></a>  <span class="comment">     * @param (string) $url The URL of the login page. If not setted redirect to the 'loginPage' config. If the this config</span>
<a name="l61"><span class="linenum">  61</span></a>  <span class="comment">     *                 also unsetted create a login action that equal with logIn(); function.</span>
<a name="l62"><span class="linenum">  62</span></a>  <span class="comment">     * @return void</span>
<a name="l63"><span class="linenum">  63</span></a>  <span class="comment">     */</span>
<a name="l64"><span class="linenum">  64</span></a>  	public function <a class="function" onClick="logFunction('trigger')" href="_functions/trigger.html" onMouseOver="funcPopup(event,'trigger')">trigger</a>();
<a name="l65"><span class="linenum">  65</span></a>   
<a name="l66"><span class="linenum">  66</span></a>      <span class="comment">/**</span>
<a name="l67"><span class="linenum">  67</span></a>  <span class="comment">     * Login the SSO user.</span>
<a name="l68"><span class="linenum">  68</span></a>  <span class="comment">     * Use these function in your login page.</span>
<a name="l69"><span class="linenum">  69</span></a>  <span class="comment">     *</span>
<a name="l70"><span class="linenum">  70</span></a>  <span class="comment">     * WARNING: This function is can't garantee that the user logged in!</span>
<a name="l71"><span class="linenum">  71</span></a>  <span class="comment">     * You can always use the 'isLogin();' function after this function to check that the user really logged in.</span>
<a name="l72"><span class="linenum">  72</span></a>  <span class="comment">     *</span>
<a name="l73"><span class="linenum">  73</span></a>  <span class="comment">     * @param void</span>
<a name="l74"><span class="linenum">  74</span></a>  <span class="comment">     * @return void</span>
<a name="l75"><span class="linenum">  75</span></a>  <span class="comment">     */</span>
<a name="l76"><span class="linenum">  76</span></a>  	public function <a class="function" onClick="logFunction('logIn')" href="_functions/login.html" onMouseOver="funcPopup(event,'login')">logIn</a>();
<a name="l77"><span class="linenum">  77</span></a>  
<a name="l78"><span class="linenum">  78</span></a>      <span class="comment">/**</span>
<a name="l79"><span class="linenum">  79</span></a>  <span class="comment">     * Logout the SSO user.</span>
<a name="l80"><span class="linenum">  80</span></a>  <span class="comment">     * Use these function in your logout page.</span>
<a name="l81"><span class="linenum">  81</span></a>  <span class="comment">     *</span>
<a name="l82"><span class="linenum">  82</span></a>  <span class="comment">     * @param void</span>
<a name="l83"><span class="linenum">  83</span></a>  <span class="comment">     * @return void</span>
<a name="l84"><span class="linenum">  84</span></a>  <span class="comment">     */</span>
<a name="l85"><span class="linenum">  85</span></a>  	public function <a class="function" onClick="logFunction('logOut')" href="_functions/logout.html" onMouseOver="funcPopup(event,'logout')">logOut</a>();
<a name="l86"><span class="linenum">  86</span></a>   
<a name="l87"><span class="linenum">  87</span></a>      <span class="comment">/**</span>
<a name="l88"><span class="linenum">  88</span></a>  <span class="comment">     * Is the user logged in?</span>
<a name="l89"><span class="linenum">  89</span></a>  <span class="comment">     *</span>
<a name="l90"><span class="linenum">  90</span></a>  <span class="comment">     * @param void</span>
<a name="l91"><span class="linenum">  91</span></a>  <span class="comment">     * @return (bool) TRUE if the user logged in and FALSE if not.</span>
<a name="l92"><span class="linenum">  92</span></a>  <span class="comment">     */</span>
<a name="l93"><span class="linenum">  93</span></a>  	public function <a class="function" onClick="logFunction('isLogin')" href="_functions/islogin.html" onMouseOver="funcPopup(event,'islogin')">isLogin</a>();
<a name="l94"><span class="linenum">  94</span></a>  
<a name="l95"><span class="linenum">  95</span></a>      <span class="comment">/**</span>
<a name="l96"><span class="linenum">  96</span></a>  <span class="comment">     * Get the user's data.</span>
<a name="l97"><span class="linenum">  97</span></a>  <span class="comment">     * Logged in usage only.</span>
<a name="l98"><span class="linenum">  98</span></a>  <span class="comment">     *</span>
<a name="l99"><span class="linenum">  99</span></a>  <span class="comment">     * @param (string) $dataName The name of the user's data. Use 'sso_' prefix to access the user's SSO data.</span>
<a name="l100"><span class="linenum"> 100</span></a>  <span class="comment">     * @return (array|bool|multi) The value of the user's data. If '$dataName' is empty return a single array with all of</span>
<a name="l101"><span class="linenum"> 101</span></a>  <span class="comment">     *         the data. If '$dataName' is invalid return (bool)FALSE. Use 'sso_' prefix to access the user's SSO data.</span>
<a name="l102"><span class="linenum"> 102</span></a>  <span class="comment">     */</span>
<a name="l103"><span class="linenum"> 103</span></a>  	public function <a class="function" onClick="logFunction('getUserData')" href="_functions/getuserdata.html" onMouseOver="funcPopup(event,'getuserdata')">getUserData</a>(<a class="var it62" onMouseOver="hilite(62)" onMouseOut="lolite()" onClick="logVariable('dataName')" href="_variables/dataName.html">$dataName</a> = '');
<a name="l104"><span class="linenum"> 104</span></a>   
<a name="l105"><span class="linenum"> 105</span></a>      <span class="comment">/**</span>
<a name="l106"><span class="linenum"> 106</span></a>  <span class="comment">     * Set the user's data.</span>
<a name="l107"><span class="linenum"> 107</span></a>  <span class="comment">     * Store user's data with 'updateUser();' function. Only accept none SSO data!</span>
<a name="l108"><span class="linenum"> 108</span></a>  <span class="comment">     * Logged in usage only.</span>
<a name="l109"><span class="linenum"> 109</span></a>  <span class="comment">     *</span>
<a name="l110"><span class="linenum"> 110</span></a>  <span class="comment">     * @param (string) $data Single array of the user's data. Keys represents the data name.</span>
<a name="l111"><span class="linenum"> 111</span></a>  <span class="comment">     * @return void</span>
<a name="l112"><span class="linenum"> 112</span></a>  <span class="comment">     */</span>
<a name="l113"><span class="linenum"> 113</span></a>  	public function <a class="function" onClick="logFunction('setUserData')" href="_functions/setuserdata.html" onMouseOver="funcPopup(event,'setuserdata')">setUserData</a>(<a class="var it4" onMouseOver="hilite(4)" onMouseOut="lolite()" onClick="logVariable('data')" href="_variables/data.html">$data</a>);
<a name="l114"><span class="linenum"> 114</span></a>   
<a name="l115"><span class="linenum"> 115</span></a>  }
<a name="l116"><span class="linenum"> 116</span></a>  
<a name="l117"><span class="linenum"> 117</span></a>  ?&gt;
</pre>
</div>
<script language="JavaScript" type="text/javascript">
FUNC_DATA={
'setuserdata': ['setuserdata', 'Set the user\'s data. Store user\'s data with \'updateUser();\' function. Only accept none SSO data! Logged in usage only. ', [['','open-sso.abstract.php',874],['','open-sso.interface.php',105]], 0],
'getuserdata': ['getuserdata', 'Get the user\'s data. Logged in usage only. ', [['','open-sso.abstract.php',833],['','open-sso.interface.php',95]], 0],
'http': ['http', 'Get HTTP connection, not HTTPS. If the user request this \'page\' with SSL (HTTPS) this function redirect to the non secured version of the \'page\' (HTTP). For example: https://example.org/dir/file.php?var=1 redirect to http://example.org/dir/file.php?var=1 ', [['','open-sso.abstract.php',459],['','open-sso.interface.php',22]], 0],
'logout': ['logout', 'Logout the SSO user. Use these function in your logout page. ', [['','open-sso.abstract.php',678],['','open-sso.interface.php',78]], 2],
'login': ['login', 'Login the SSO user. Use these function in your login page. ', [['','open-sso.abstract.php',621],['','open-sso.interface.php',66]], 1],
'trigger': ['trigger', 'Trigger. These function create a simple redirect to the login page. Use these function in your trigger page. In default you shouldn\'t use these function. But if you should put trigger to another page than the default (\'trigger.php\'), you can do this with this function. ', [['','open-sso.abstract.php',749],['','open-sso.interface.php',52]], 1],
'https': ['https', 'Get HTTPS connection, not HTTP. If the user request this \'page\' without SSL (HTTP) this function redirect to the secured version of the \'page\' (HTTPS). For example: http://example.org/dir/file.php?var=1 redirect to https://example.org/dir/file.php?var=1 ', [['','open-sso.abstract.php',441],['','open-sso.interface.php',32]], 3],
'ishttps': ['ishttps', 'Is secured, HTTPS connection?. If the user request this \'page\' without SSL (HTTP) this function redirect to the secured version of the \'page\' (HTTPS). For example: http://example.org/dir/file.php?var=1 redirect to https://example.org/dir/file.php?var=1 ', [['','open-sso.abstract.php',477],['','open-sso.interface.php',42]], 3],
'islogin': ['islogin', 'Is the user logged in?. Look after in session that the user is logged in or not. ', [['','open-sso.abstract.php',769],['','open-sso.interface.php',87]], 8]};
CLASS_DATA={
'opensso_api': ['opensso_api', 'API interface for OpenSSO PHP library. ', [['','open-sso.interface.php',2]], 1]};
CONST_DATA={
};
</script>
<div id="func-popup" class="funcpopup"><p id="func-title" class="popup-title">title</p><p id="func-desc" class="popup-desc">Description</p><p id="func-body" class="popup-body">Body</p></div>
<div id="class-popup" class="funcpopup"><p id="class-title" class="popup-title">title</p><p id="class-desc" class="popup-desc">Description</p><p id="class-body" class="popup-body">Body</p></div>
<div id="const-popup" class="funcpopup"><p id="const-title" class="popup-title">title</p><p id="const-desc" class="popup-desc">Description</p><p id="const-body" class="popup-body">Body</p></div>
<div id="req-popup" class="funcpopup"><p id="req-title" class="popup-title">title</p><p id="req-body" class="popup-body">Body</p></div>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
	<tr><td>Generated: Fri Jan  8 00:38:44 2010</td>
	<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7</a></i></td>
	</tr>
</table>
</body></html>
